<?php 
$weekarr = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
$week = $weekarr[date("w")];
?>
<div id="intermediary" class="indexcontentdiv">
    <div class="positiondiv">
        <table>
            <tr>
                <td class="td-left">
                    <img src="<?=base_url()?>resource/img/home_ico.png" width="21" height="17">
                    Data Entry > <a href="<?=base_url()?>index/intermediary">Intermediary</a> > New Intermediary
                </td>
                <td class="td-right">
                    <img src="<?=base_url()?>resource/img/menu2.png" width="27" height="24">Today is <?=$week?>,<?=date('M d,Y')?>
                </td>
            </tr>
        </table>
    </div>
    <div class="input-div">
        <?php echo form_open_multipart('index/new_intermediary'); ?>
        <input type="hidden" name="type" value="2" />
        <table>
            <tr><td></td><td><span class="err"><?=validation_errors();?></span></td></tr>
            <tr><td colspan="2"><h3>.Intermediary</h3></td></tr>
            <tr><td class="nametd">Company Name:</td><td><input type="text" name="name"/><span class="err">*</span></td></tr>
            <tr><td class="nametd">Region:</td><td><input type="text" name="region"/></td></tr>
            <tr><td class="nametd">Email:</td><td><input type="text" name="email"/></td></tr>
            <tr><td class="nametd">QQ:</td><td><input type="text" name="qq"/></td></tr>
            <tr><td class="nametd">Contact Person:</td><td><input type="text" name="person"/></td></tr>
            <tr><td class="nametd">Phone Number:</td><td><input type="text" name="number"/></td></tr>
            
            <tr><td class="nametd">Comments:</td>
                <td>
                    <textarea name="comment"></textarea>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="submit" value="Save"/>
                    <input type="button" value="Reset"/>
                </td>
            </tr>
        </table>
        <?php echo form_close(); ?>
    </div>
</div>
<script>
$("input[name='name']").focus(function(){
}).blur(function(){
    if($(this).val() == ''){
        alert("Name can not be empty！");
    }
});

$("input[type='button']").click(function(){
    $("input[name='name']").val('');
    $("input[name='person']").val('');
    $("input[name='number']").val('');
    $("input[name='qq']").val('');
    $("input[name='region']").val('');
    $("input[name='email']").val('');
    $("textarea[name='comment']").val('');
});
</script>
　